﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System
{
    /// <summary>
    /// 文本操作类
    /// </summary>
    public class CString
    {
        public static string CutString(string str, int length, bool ShowEnd)
        {
            string newString = String.Empty;

            if (str != "")
            {
                if (str.Length > length)
                {
                    if (ShowEnd)
                    {
                        newString = str.Substring(0, length - 2) + "";
                    }
                    else
                    {
                        newString = str.Substring(0, length);
                    }
                }
                else
                {
                    newString = str;
                }
            }

            return newString;
        }
        public static string CutString(string str, int length)
        {
            return CutString(str, length, true);
        }


        public static string MakeCamel(string value)
        {
            return value.Substring(0, 1).ToUpper() + value.Substring(1);
        }
    }
}
